package ctr.eleve;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import vue.MenuControle;
import vue.eleve.JPanRechercherListeEleve;
import vue.eleve.RechercherEleve;

public class GestMouseRechercherEleve implements MouseListener {
	
	private RechercherEleve jPanAppelant;
	private JPanRechercherListeEleve jPanList;

	public GestMouseRechercherEleve(JPanRechercherListeEleve jPanLis, RechercherEleve jPanAppelant){
		this.jPanAppelant = jPanAppelant;
		this.jPanList =  jPanLis;
	}
	@Override
	public void mouseClicked(MouseEvent e) {
		// On recupere l'eleve séléctionné, pour le setter ensuite dans le JPanel appelant.
		int index = this.jPanList.getPanJTable().getJtable().getSelectedRow();
		jPanAppelant.setEleve(this.jPanList.getlEleve().get(index));
		// On le reaffiche ensuite.
		MenuControle.afficherPan(jPanAppelant.init());
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
